package com.nuvsoft.android.nuvgamenet;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

public class GamePlayer {
	private View v;

	public String getNick() {
		return nick;
	}

	String nick;

	public GamePlayer(String nick) {
		this.nick = nick;
	}

	public View getListView(Context c) {
		if (v == null) {
			LayoutInflater vi = (LayoutInflater) c
					.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
			v = vi.inflate(R.layout.player_row, null);
		}
		TextView tv_nick = (TextView) v.findViewById(R.id.tv_player_nick);
		ImageView iv_icon = (ImageView) v.findViewById(R.id.iv_icon);
		if (tv_nick != null) {
			tv_nick.setText(getNick());
		}
		iv_icon.setImageResource(R.drawable.icon);
		return v;
	}
}